﻿'Description:批次检验类
'Copyright (c) : 通力凯顿（北京）系统集成有限公司
'Writer:Yuxj
'create Date:2017-10-31
'Rewriter:
'Rewrite Date:
Imports BusinessRule.DTO
Public Interface uLMSIssueERPMaterialIbusiness
    ''' <summary>
    ''' Add by Yuxj20190627 根据任务单查询配套数据
    ''' </summary>
    ''' <param name="cno"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetIssueErpMaterialbyCno(ByVal cno As String, Optional ByVal mfgorderName As String = "") As DataTable
    ''' <summary>
    ''' Add by Yuxj
    ''' Modify by Yuxj20190625 集件去封页面将任务单和零件分卡
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetCollectContainerNo(ByVal para As Dictionary(Of String, String)) As uMESProcessResult
    Function GetFactoryList() As DataTable
    Function GetIssueERPMaterial(ByVal para As Dictionary(Of String, String)) As uMESProcessResult
    Function GetPartMenuinfo(ByVal para As Dictionary(Of String, String)) As DataTable
    Function GetBomList(ByVal BomId As String) As System.Data.DataTable
    ''' <summary>
    ''' yuxj20190620处理任务单生成时，因异常导致批次开立但enginepartplan id没有更新进去的情况
    ''' </summary>
    ''' <param name="mfgid"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetTaskExceptionData(ByVal mfgid As String) As DataTable
    ''' <summary>
    ''' 20190619yuxj配套查询
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetIssueMaterialQuery(ByVal para As Dictionary(Of String, String)) As uMESProcessResult
    ''' <summary>
    ''' Modify by Yuxj20180627 修改方法，增加初检装的筛选
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function CalcBomData(ByVal para As Dictionary(Of String, String)) As System.Data.DataTable
    Function InsertPartMenu(ByVal paraMenu As Dictionary(Of String, String)) As Boolean
    Function InsertPartMenuTable(ByVal entity As BusinessRule.DTO.IssueERPMaterialDTO) As Boolean
    Function FillInsertPartMenu(ByVal entity As BusinessRule.DTO.IssueERPMaterialDTO) As Object()

    Function UpdatePartMenuInfo(ByVal entity As BusinessRule.DTO.IssueERPMaterialDTO) As Boolean
    ''' <summary>
    ''' 删除零件目录
    ''' </summary>
    ''' <param name="entity"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function DeletePartMenuInfo(ByVal entity As BusinessRule.DTO.IssueERPMaterialDTO) As Boolean
    ''' <summary>
    ''' 填充删除零件目录语句
    ''' create by Yangsj 2020-7-22
    ''' </summary>
    ''' <param name="entity"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function FillDeletePartMenuInfo(ByVal entity As BusinessRule.DTO.IssueERPMaterialDTO) As Object()
    Function GetCollectStockQty(ByVal para As Dictionary(Of String, String)) As DataSet
    Function DeleteIssueERPMaterial(ByVal strid As String) As Boolean
    Function InsertIssueErpMaterial(ByVal entity As BusinessRule.DTO.IssueERPMaterialDTO) As Boolean
    ''' <summary>
    ''' 填充插入语句
    ''' </summary>
    ''' <param name="entity"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function FillInsertIssueErpMaterial(ByVal entity As BusinessRule.DTO.IssueERPMaterialDTO) As Object()
    Function GetPartMenuInfoFirstQty(ByVal strid As String) As String
    Function GetLackQty(ByVal para As Dictionary(Of String, String)) As uMESProcessResult
    Function GetMuliLackQty(ByVal para As Dictionary(Of String, String)) As uMESProcessResult
    Function GetMuliLackDetail(ByVal ContainerNolist As String, ByVal strMfgOrderList As String) As DataTable
    Function GetCollectIssue(ByVal para As Dictionary(Of String, String)) As DataTable 'Modify uMESProcessResult->DataTable
    Function InsertIssueERPMaterialConfirmation(ByVal para As Dictionary(Of String, String)) As Boolean
    ''' <summary>
    ''' add by yuxj 20180112装试检验报废插入
    ''' </summary>
    ''' <param name="para"></param>
    ''' <param name="ZSFlag"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function InsertIssueERPMaterialScrapInfo(ByVal para As Dictionary(Of String, String), ByVal ZSFlag As String) As Boolean

    ''' <summary>
    ''' 自动配套任务单
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function AutoMatchTaskBill(ByVal para As Dictionary(Of String, String)) As String

    ''' <summary>
    ''' Add by Yuxj20180510根据工艺路线获取Bom信息
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function CalcBomDatabyWorkflowid(ByVal para As Dictionary(Of String, String)) As System.Data.DataTable
    Function GetIssueMenuInfoDS(ByVal para As Dictionary(Of String, String)) As DataSet

    ''' <summary>
    ''' 更新EnginePartPlan表
    ''' </summary>
    ''' <param name="cid"></param>
    ''' <param name="cname"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function UpdateEnginePartPlanID(ByVal cid As String, ByVal cname As String) As Boolean
    Function FillUpdateEnginePartPlanID(ByVal cid As String, ByVal cname As String, ByVal isEnginePart As Boolean) As Object()
    ''' <summary>
    ''' 获取订单没有开卡的批次以开卡
    ''' </summary>
    ''' <param name="mfgid"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetMfgContainerDT(ByVal mfgid As String, ByVal ContainerNo As String) As DataTable

    ''' <summary>
    ''' add by Yuxj20180409 获取装试检验弹窗装配信息
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetWorkMaterialRecord(ByVal para As Dictionary(Of String, String)) As DataTable

    ''' <summary>
    ''' 获取订单资料
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetMfgorderInfo(ByVal para As Dictionary(Of String, String)) As DataTable

    ''' <summary>
    ''' 获取串件单周转单列表
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetExchangeBillData(ByVal para As Dictionary(Of String, String)) As DataTable

    ''' <summary>
    ''' 更新串件单周转单信息 create by tianFW 2018年5月25日
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function UpdateExchangeBillData(ByVal para As Dictionary(Of String, String)) As Boolean

    ''' <summary>
    ''' 获取任务单打印信息 add YangJiang 20180508
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetTaskBillPrintInfo(ByVal ContainerID As String, ByVal parttype As String, ByVal SmallPartType As String) As DataTable

    ''' <summary>
    ''' Add by Yuxj 20180531 根据故检任务单获取发动机所有件号
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetMfgProduct(ByVal para As Dictionary(Of String, String)) As DataTable

    ''' <summary>
    ''' Add by Yuxj20180601
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetGJIssueMaterialIntegratedData(ByVal para As Dictionary(Of String, String)) As DataTable

    ''' <summary>
    ''' Add by Yuxj20180606插入集件信息表
    ''' </summary>
    ''' <param name="entity"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function InsertCollectErpMaterial(ByVal entity As BusinessRule.DTO.IssueERPMaterialDTO) As Boolean

    ''' <summary>
    ''' 判断订单批次件号信息是否存在
    ''' </summary>
    ''' <param name="entity"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function BoolCollectErpMaterialExist(ByVal entity As BusinessRule.DTO.IssueERPMaterialDTO) As Boolean
    ''' <summary>
    ''' 判断订单是否存在
    ''' </summary>
    ''' <param name="mfgname"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function boolMfgOrderExist(ByVal mfgname As String) As Boolean
    ''' <summary>
    ''' 判断件号是否存在
    ''' </summary>
    ''' <param name="Productname"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function boolProductNameExist(ByVal Productname As String) As Boolean
    ''' <summary>
    ''' 删除已经存在的订单批次件号信息
    ''' </summary>
    ''' <param name="entity"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function DeleteCollectErpMaterial(ByVal entity As BusinessRule.DTO.IssueERPMaterialDTO) As Boolean
    ''' <summary>
    ''' Add by Yuxj20180608如果任务单当前阶段没有配套，获取上一个阶段的配套资料
    ''' </summary>
    ''' <param name="ContainerNo"></param>
    ''' <param name="Cid"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetLastIssueContainerDT(ByVal ContainerNo As String, ByRef Cid As String) As DataTable

    ''' <summary>
    ''' Add by Yuxj20180612 根据批次ID查询配套数据
    ''' </summary>
    ''' <param name="cid"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetIssueErpMaterialbyCid(ByVal cid As String) As DataTable

    ''' <summary>
    '''  Add by Yuxj20180710
    ''' 获取发动机件号
    ''' </summary>
    ''' <param name="MfgOrder"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetEngineProduct(ByVal MfgOrder As String) As String
    ''' <summary>
    ''' Add by Yuxj20180724
    ''' 获取任务单号对应的大阶段和部件工艺
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetEngineStepAndWorkflowInfo(ByVal para As Dictionary(Of String, String)) As DataTable

    ''' <summary>
    ''' Add by Yuxj20180725
    ''' 获取检测项对应的录入信息
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetStepCheckPointData(ByVal para As Dictionary(Of String, String)) As DataTable

    ''' <summary>
    ''' Add by Yuxj20180821
    ''' 装配表打印查询sql
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetIssueERPMaterialPrint(ByVal para As Dictionary(Of String, String)) As uMESProcessResult

    ''' <summary>
    ''' Add by Yuxj20181016
    ''' 判断是否需要插入工时表ContainerSteptimeSheet
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function CheckInsertContainerSteptimeSheet(ByVal para As Dictionary(Of String, String)) As Boolean

    ''' <summary>
    ''' Add by Yuxj20181017
    ''' 获取集件去封工步信息
    ''' </summary>
    ''' <param name="WorkFlowId"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetCollectWorkFlowData(ByVal WorkFlowId As String, ByVal PartType As String) As DataTable

    ''' <summary>
    ''' Modify by Yuxj20181023
    ''' </summary>
    ''' <param name="mfgorder"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetCollectErpMaterial(ByVal mfgorder As String) As DataTable

    ''' <summary>
    ''' Add by Yuxj20181108 任务单整机打印方法
    ''' </summary>
    ''' <param name="MachineNo"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetContainerNoByMachine(ByVal MachineNo As String) As DataTable

    ''' <summary>
    ''' Add by Yuxj20181108
    ''' 根据批次Id获取配套信息
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetIssueErpMaterialbyContainer(ByVal para As Dictionary(Of String, String)) As DataTable

    ''' <summary>
    ''' Add by Yuxj20181108
    ''' 配套件调整
    ''' </summary>
    ''' <param name="idList"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function UpdateIssueErpMaterial(ByVal idList As String) As Boolean

    ''' <summary>
    ''' Add by Yuxj20181213 获取零件批次信息
    ''' </summary>
    ''' <param name="Batch"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetBatchInfo(ByVal Batch As String) As DataTable

    ''' <summary>
    ''' 获取批次对应订单信息
    ''' </summary>
    ''' <param name="cid"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetContainerInfoByContainerId(ByVal cid As String) As DataTable
#Region "任务单配套更改"
    Function GetIssueMaterialNotFinished(ByVal para As Dictionary(Of String, String)) As DataTable

    Function GetCollectErpBufferData(ByVal para As Dictionary(Of String, String)) As DataTable
#End Region

#Region "零组件交接"
    '获取配送人执行sql
    Function GetPartsAssembleSql(ByVal para As Dictionary(Of String, String)) As String

    '获取接收人执行sql
    Function GetPartsAcceptSql(ByVal para As Dictionary(Of String, String)) As String

    '获取零组件状态(0,未配送;1,已配送;2,已接收)
    Function GetPartsStatus(ByVal ISSUEERPMATERIALID As String) As String

    '批量执行事务
    Function PartsReceptTran(ByVal para As ArrayList) As Boolean
    '根据WorkFlowId、SpecId 获取 WorkFlowStepID
    Function GetWorkFlowStepID(ByVal WorkFlowId As String, ByVal SpecId As String) As String
#End Region
End Interface
